package cn.bdqn.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.bdqn.dao.devuser.DevUserDao;
import cn.bdqn.entity.DevUser;
import cn.bdqn.service.DevUserService;

@Service
@Transactional
public class DevUserServiceImpl implements DevUserService {
	@Autowired
	private DevUserDao devUserDao;

	@Override
	public DevUser login(String username, String password) throws Exception {
		DevUser devUser = devUserDao.checkDevUserByUserName(username);
		if(devUser == null){
			//用户名不存在
			return null;
		}else{
			//用户名存在
			if(devUser.getDevpassword().equals(password)){
				//登陆成功
				return devUser;
			}else{
				//密码错误
				return null;
			}
			
		}
	}
	
}
